//
//  Dog.swift
//  APPTestSwift
//
//  Created by hiking on 2020/2/19.
//  Copyright © 2020 hiking. All rights reserved.
//

import UIKit

//正确的init流程：在super.init()之前将类中的非可选属性初始化
class Dog :Animal {
    var name:String
    
    override init() {
        self.name = ""
        super.init()
    }
    init(name:String,age:Int) {
        self.name = name
//        self.height = 12  //不能再super调用之前使用super中的属性
        super.init()
        self.height = 15
        print("dog构造方法",height)
        
        
        
    }
    convenience init(sex:String) {
        self.init(name:"hhh",age:12)
        print(name,sex)
    }
    convenience init(age:Int) {
        self.init(sex:"12")
    }
}
